package com.itheima;

public class TestLambda4 {
    public static void main(String[] args) {
       useCalculator(new Calculator() {
           @Override
           public int calc(int a, int b) {
               return a+b;
           }
       });
       useCalculator((int a, int b)->
           a+b
       );

    }
    public static void useCalculator(Calculator calculator){
        int result=calculator.calc(11,22);
        System.out.println(result);
    }
}
interface Calculator{
    int calc(int a,int b);
}